/*
 * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The OpenAirInterface Software Alliance licenses this file to You under
 * the OAI Public License, Version 1.1  (the "License"); you may not use this
 * file except in compliance with the License. You may obtain a copy of the
 * License at
 *
 *      http://www.openairinterface.org/?page_id=698
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *-------------------------------------------------------------------------------
 * For more information about the OpenAirInterface (OAI) Software Alliance:
 *      contact@openairinterface.org
 */
/**
 * Nudr_DataRepository API OpenAPI file
 * Unified Data Repository Service. © 2020, 3GPP Organizational Partners (ARIB,
 * ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
 *
 * The version of the OpenAPI document: 2.1.2
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator
 * (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
 * the class manually.
 */

#include "UsageThreshold.h"

namespace oai::udr::model {

UsageThreshold::UsageThreshold() {
  m_Duration = 0;
  m_DurationIsSet = false;
  m_TotalVolume = 0L;
  m_TotalVolumeIsSet = false;
  m_DownlinkVolume = 0L;
  m_DownlinkVolumeIsSet = false;
  m_UplinkVolume = 0L;
  m_UplinkVolumeIsSet = false;
}

UsageThreshold::~UsageThreshold() {}

void UsageThreshold::validate() {
  // TODO: implement validation
}

void to_json(nlohmann::json &j, const UsageThreshold &o) {
  j = nlohmann::json();
  if (o.durationIsSet())
    j["duration"] = o.m_Duration;
  if (o.totalVolumeIsSet())
    j["totalVolume"] = o.m_TotalVolume;
  if (o.downlinkVolumeIsSet())
    j["downlinkVolume"] = o.m_DownlinkVolume;
  if (o.uplinkVolumeIsSet())
    j["uplinkVolume"] = o.m_UplinkVolume;
}

void from_json(const nlohmann::json &j, UsageThreshold &o) {
  if (j.find("duration") != j.end()) {
    j.at("duration").get_to(o.m_Duration);
    o.m_DurationIsSet = true;
  }
  if (j.find("totalVolume") != j.end()) {
    j.at("totalVolume").get_to(o.m_TotalVolume);
    o.m_TotalVolumeIsSet = true;
  }
  if (j.find("downlinkVolume") != j.end()) {
    j.at("downlinkVolume").get_to(o.m_DownlinkVolume);
    o.m_DownlinkVolumeIsSet = true;
  }
  if (j.find("uplinkVolume") != j.end()) {
    j.at("uplinkVolume").get_to(o.m_UplinkVolume);
    o.m_UplinkVolumeIsSet = true;
  }
}

int32_t UsageThreshold::getDuration() const { return m_Duration; }
void UsageThreshold::setDuration(int32_t const value) {
  m_Duration = value;
  m_DurationIsSet = true;
}
bool UsageThreshold::durationIsSet() const { return m_DurationIsSet; }
void UsageThreshold::unsetDuration() { m_DurationIsSet = false; }
int64_t UsageThreshold::getTotalVolume() const { return m_TotalVolume; }
void UsageThreshold::setTotalVolume(int64_t const value) {
  m_TotalVolume = value;
  m_TotalVolumeIsSet = true;
}
bool UsageThreshold::totalVolumeIsSet() const { return m_TotalVolumeIsSet; }
void UsageThreshold::unsetTotalVolume() { m_TotalVolumeIsSet = false; }
int64_t UsageThreshold::getDownlinkVolume() const { return m_DownlinkVolume; }
void UsageThreshold::setDownlinkVolume(int64_t const value) {
  m_DownlinkVolume = value;
  m_DownlinkVolumeIsSet = true;
}
bool UsageThreshold::downlinkVolumeIsSet() const {
  return m_DownlinkVolumeIsSet;
}
void UsageThreshold::unsetDownlinkVolume() { m_DownlinkVolumeIsSet = false; }
int64_t UsageThreshold::getUplinkVolume() const { return m_UplinkVolume; }
void UsageThreshold::setUplinkVolume(int64_t const value) {
  m_UplinkVolume = value;
  m_UplinkVolumeIsSet = true;
}
bool UsageThreshold::uplinkVolumeIsSet() const { return m_UplinkVolumeIsSet; }
void UsageThreshold::unsetUplinkVolume() { m_UplinkVolumeIsSet = false; }

} // namespace oai::udr::model
